<html>
<script>
    function addFunc(num = 0) {
        alert(num + 1);
    }
    function addFunc1(num) {
        alert(num + 1);
    }
</script>

<body>
    <button onClick="addFunc(1)">按钮-穿指定值</button>
    <button onClick="addFunc()">按钮-有默认值</button>
    <button onClick="addFunc1()">按钮-无默认值</button>
    <button id="J_button3">按钮-使用addEvent来绑定</button>
    <button id="J_button4">按钮-使用onclick来绑定</button>
</body>
<script>
    // 这种绑定方式不会被覆盖
    document.getElementById("J_button3").addEventListener("click", () => {
        addFunc(5);
    })
    document.getElementById("J_button3").addEventListener("click", () => {
        addFunc(67);
    })
    // 这种绑定方式会被覆盖
    document.getElementById("J_button4").onclick = () => addFunc(4);
    document.getElementById("J_button4").onclick = () => addFunc(44);
</script>

</html>